package com.yc.sole.erp.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yc.sole.framework.mybatis.entity.BaseEntity;
import jakarta.persistence.*;
import lombok.Data;

import java.math.BigDecimal;

/**
 * @author yizuomin
 * @date 2024/3/13 09:26
 **/
@Data
@Entity
@Table(name = "erp_outsourced_order")
@TableName(value = "erp_outsourced_order", autoResultMap = true)
public class OsOrder extends BaseEntity {

    /**
     * id
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @TableId(type = IdType.AUTO)
    private Long id;
    /**
     * 外发订单编号
     */
    @Column(columnDefinition = "VARCHAR(32) NOT NULL COMMENT '外发订单编号'", unique = true)
    private String osOrderNo;
    /**
     * 外发日期
     */
    @Column(columnDefinition = "VARCHAR(20) NOT NULL COMMENT '外发日期'")
    private String date;
    /**
     * 原订单id
     */
    @Column(columnDefinition = "BIGINT NOT NULL COMMENT '原订单id'")
    private Long orderId;
    /**
     * 原订单编号
     */
    @Column(columnDefinition = "VARCHAR(32) NOT NULL COMMENT '原订单编号'")
    private String orderNo;
    /**
     * 供应商id
     */
    @Column(columnDefinition = "BIGINT NOT NULL COMMENT '供应商id'")
    private Long supplierId;
    /**
     * 供应商名称
     */
    @Column(columnDefinition = "VARCHAR(50) NOT NULL COMMENT '供应商名称'")
    private String supplierName;
    /**
     * 外发单价
     */
    @Column(columnDefinition = "DECIMAL(18,2) NOT NULL COMMENT '外发单价'")
    private BigDecimal unitPrice;
    /**
     * 外发数量
     */
    @Column(columnDefinition = "INT UNSIGNED NOT NULL COMMENT '外发数量'")
    private Integer quantity;
    /**
     * 利润
     */
    @Column(columnDefinition = "DECIMAL(18,2) NOT NULL COMMENT '利润'")
    private BigDecimal profit;
    /**
     * 备注
     */
    @Column(columnDefinition = "VARCHAR(255) COMMENT '备注'")
    private String remark;
    /**
     * 客户id
     */
    @Column(columnDefinition = "BIGINT NOT NULL COMMENT '客户id'")
    private Long customerId;
    /**
     * 客户名称
     */
    @Column(columnDefinition = "VARCHAR(50) NOT NULL COMMENT '客户名称'")
    private String customerName;
    /**
     * 产品id
     */
    @Column(columnDefinition = "BIGINT NOT NULL COMMENT '产品id'")
    private Long productId;
    /**
     * 产品名称
     */
    @Column(columnDefinition = "VARCHAR(50) NOT NULL COMMENT '产品名称'")
    private String productName;
    /**
     * 订单单价
     */
    @Column(columnDefinition = "DECIMAL(18,2) UNSIGNED NOT NULL COMMENT '订单单价'")
    private BigDecimal orderUnitPrice;
    /**
     * 总价
     */
    @Column(columnDefinition = "DECIMAL(18,2) UNSIGNED NOT NULL COMMENT '总价'")
    private BigDecimal amount;
    /**
     * 是否删除
     */
    @TableLogic
    @Column(columnDefinition = "INT NOT NULL DEFAULT 0 COMMENT '是否已删除'")
    private Integer deleted;
}
